<template>
	<view>
		<tn-nav-bar :isBack='true' :backTitle='" "' bottomShadow :alpha="alpha">我的钱包
		</tn-nav-bar>
		<image src="/static/product/topbg.png" class="topbg" mode=""></image>
		
		<loading v-if="loading"></loading>
		
		<view :style="{paddingTop:'calc('+vuex_custom_bar_height+'px)'}" class="con" v-else>
			<view class="con__top">
				<image src="/static/sy/qbbg.png" class="con__top__bg" mode=""></image>
				<image src="/static/sy/txbgicon.png" class="con__top__bg__icon" mode=""></image>
				<view class="con__top__box">
					<view class="tn-flex tn-flex-col-center">
						<view class="con__top__b tn-flex tn-flex-col-center">
							我的余额(元）
							<view class="tn-flex tn-flex-col-center" @click="iseye=!iseye">
								<text class="tn-icon-eye" style="font-size: 36rpx;" v-if="!iseye"></text>
								<text class="tn-icon-eye-hide" style="font-size: 36rpx;" v-else></text>
							</view>
						</view>
						
					</view>
					<view class="con__top__c" v-if="iseye">
						{{info.money}}
					</view>
					<view class="con__top__c" v-else>
						***
					</view>
					<view class="con__top__d">
						<view class="con__top__d__item">
							<view class="con__top__d__item__text">
								总收益
								<image src="/static/sy/wh.png" class="con__top__d__item__text__icon" mode=""></image>
							</view>
							<view class="con__top__d__item__value">
								{{info.totalMoney}}
							</view>
						</view>
						<view class="con__top__d__line">

						</view>
						<view class="con__top__d__item">
							<view class="con__top__d__item__text">
								今日收益
								<image src="/static/sy/wh.png" class="con__top__d__item__text__icon" mode=""></image>
							</view>
							<view class="con__top__d__item__value">
								{{info.todayMoney}}
							</view>
						</view>
						<view class="con__top__d__line">

						</view>
						<view class="con__top__d__item">
							<view class="con__top__d__item__text">
								总支出
								<image src="/static/sy/wh.png" class="con__top__d__item__text__icon" mode=""></image>
							</view>
							<view class="con__top__d__item__value">
								{{info.zcMoney}}
							</view>
						</view>
					</view>
				</view>
			</view>
			<view class="" style="padding-right: 30rpx;">
				<view class="con__tx" @click="to('/pages/my/withdrawal')">
					<view class="tn-flex tn-flex-col-center">
						<image src="/static/sy/tx.png" class="con__tx__title" mode=""></image>
						余额{{info.money}}元可提现到微信

					</view>
					<text class="tn-icon-right" style="color: #767A7B;"></text>
				</view>
				<view class="con__mx">
					<view class="con__mx__top">
						<image src="/static/my/txng.png" class="con__mx__topbg" mode=""></image>
						<view class="con__mx__top__text">
							账单<text style="color: #FB7A58;">明细</text>
						</view>
					</view>
					<scroll-view scroll-y="true" class="con__mx__box">
						<view class="con__mx__list">
							<view class="con__mx__list__item" v-for="(item,index) in info.result" :key="index">
								<view class="tn-flex tn-flex-col-center">
									<image src="/static/my/txitem.png" class="con__mx__list__item__icon" mode="">
									</image>
									<view class="con__mx__list__item__center">
										<view class="con__mx__list__item__text">
											{{item.memo}}
										</view>
										<view class="con__mx__list__item__time">
											<!-- {{item.createtime}} -->
											{{timeFormat(item.createtime,'yyyy.mm.dd hh:MM')}}
											<!-- 2023.06.11 12:25 -->
										</view>
									</view>
								</view>
								<view class="con__mx__list__item__price" v-if="item.type==2">
									<text style="font-family:PingFang-SC-Bold;">-</text>{{item.money}}
								</view>
								<view class="con__mx__list__item__price" style="color: #FF4D30;" v-if="item.type==1">
									<text style="font-family:PingFang-SC-Bold;">+</text>{{item.money}}
								</view>
							</view>
						</view>
					</scroll-view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import user from '@/api/_user.js'
	export default {
		data() {
			return {
				alpha: true,
				info:{
					result:[]
				},
				iseye:false,
				loading:true
			};
		},
		methods: {
			
		},
		onLoad() {
			user.myWallet().then(res => {
				if (res.data.code == 1) {
					this.info=res.data.data
					this.loading=false
				}
			})
		}
	}
</script>

<style lang="scss">
	page {
		background-color: #F4F4F4;
	}

	.con {
		padding-left: 28rpx;

		&__top {
			width: 723rpx;
			height: 355rpx;
			position: relative;

			&__bg {
				position: absolute;
				width: 723rpx;
				height: 355rpx;
				top: 0;
				left: 0;

				&__icon {
					width: 214rpx;
					height: 201rpx;
					position: absolute;
					top: 26rpx;
					right: 66rpx;
					z-index: 2;
				}
			}

			&__box {
				position: relative;

			}

			&__b {
				font-family: PingFang SC;
				font-weight: bold;
				font-size: 20rpx;
				color: #767A7B;
				line-height: 20rpx;
				padding-left: 41rpx;
				padding-top: 84rpx;
			}

			&__c {
				font-family: DIN Next LT Pro;
				font-weight: bold;
				font-size: 48rpx;
				color: #FF644C;
				line-height: 34rpx;
				padding: 28rpx 0 42rpx 47rpx;
			}

			&__d {
				width: 657rpx;
				height: 122rpx;
				background: rgba(255, 255, 255, 0.53);
				// box-shadow: 0rpx 18rpx 0rpx 0rpx rgba(255, 255, 255, 0.53);
				border-radius: 20rpx;
				margin-left: 18rpx;
				display: flex;
				align-items: center;
				justify-content: space-between;

				&__item {
					width: 33.33%;
					display: flex;
					flex-direction: column;
					align-items: center;
					justify-content: center;

					&__text {
						font-family: PingFang SC;
						font-weight: 800;
						font-size: 24rpx;
						color: #868A8B;
						line-height: 36rpx;
						opacity: 0.8;
						display: flex;
						align-items: center;

						&__icon {
							width: 21rpx;
							height: 21rpx;
						}
					}

					&__value {
						font-family: DINNextLTPro-Bold;
						font-weight: bold;
						font-size: 30rpx;
						color: #1C2026;
						line-height: 22rpx;
						margin-top: 18rpx;
					}
				}

				&__line {
					width: 2rpx;
					height: 19rpx;
					background: #868A8B;
					opacity: 0.2;
				}
			}
		}

		&__tx {
			display: flex;
			align-items: center;
			justify-content: space-between;
			padding: 0 36rpx;
			height: 102rpx;
			background: #FFFFFF;
			border-radius: 20rpx;
			font-family: PingFang SC;
			font-weight: 500;
			font-size: 26rpx;
			color: #6E6E7B;
			line-height: 26rpx;
			margin: 20rpx 0;

			&__title {
				width: 59rpx;
				height: 29rpx;
				margin-right: 20rpx;
			}
		}

		&__mx {
			padding: 0 30rpx 66rpx 0;

			// background:linear-gradient(#fff 0%,#F4F4F4 10%,#F4F4F4 100%);
			// margin-top: -20rpx;
			// flex: 1;
			&__top {
				width: 690rpx;
				height: 138rpx;
				position: relative;

				&__text {
					position: relative;
					padding: 43rpx 32rpx;
					font-family: AlimamaShuHeiTi;
					font-weight: bold;
					font-size: 32rpx;
					color: #00001C;
					line-height: 30rpx;
				}
			}

			&__topbg {
				width: 690rpx;
				height: 138rpx;
				position: absolute;
				top: 0;
				left: 0;
			}

			&__box {
				width: 690rpx;
				height: calc(100% - 138rpx);
				background: #FFFFFF;
				border-radius: 0rpx 0rpx 30rpx 30rpx;

			}

			&__list {
				padding-left: 35rpx;

				&__item {
					padding: 16rpx 36rpx 16rpx 0;
					display: flex;
					align-items: flex-start;
					justify-content: space-between;
					border-bottom: 1rpx solid #F4F4F4;

					&__icon {
						width: 97rpx;
						height: 97rpx;
						margin-left: -16rpx;
						margin-right: 20rpx;
					}

					&__center {
						display: flex;
						flex-direction: column;
						justify-content: center;

					}

					&__text {
						font-weight: 800;
						font-size: 27rpx;
						color: #181818;
						line-height: 27rpx;
						margin-bottom: 19rpx;
					}

					&__time {
						font-family: PingFang SC;
						font-weight: bold;
						font-size: 24rpx;
						color: #616161;
						line-height: 24rpx;
						opacity: 0.8;
					}

					&__price {
						font-family: DINNextLTPro-Bold;
						font-weight: bold;
						font-size: 34rpx;
						color: #4DC680;
						line-height: 24rpx;
						margin-top: 22rpx;
					}
				}
			}
		}
	}
</style>